<?php
/**
 * Created by PhpStorm.
 * User: Kevin
 * Date: 2019/4/18
 * Time: 17:44
 */
namespace app\api\model;
use think\Model;
use think\Db;

class prod extends Model
{
    protected $name = 'product';

    // 开启自动写入时间戳
    protected $autoWriteTimestamp = false;

    //建立和的关联
    public function photo()
    {
        return $this->hasMany('type','m_product_id');//hasMany是一对多
    }
}